<?php
/*********************
	Helper for Bootstrap Panel
**********************/

if(!function_exists('panel_head'))
{
	function panel_head($title = "Panel Title", $btns = false, $theme = "primary")
	{
		echo "
			<div class='panel panel-$theme'>
			  <div class='panel-heading'>
			  	 <h3 class='panel-title'>$title</h3>";

		if($btns && is_array($btns)){
			echo '<div class="btn-group">';
			foreach ($btns as $key => $btn) {
				$url = isset($btn['url']) ? $btn['url'] : "";
				$btn_title = isset($btn['title']) ? $btn['title'] : "";
				$attr = isset($btn['attr']) ? $btn['attr'] : "";
				echo "<a href='$url' $attr >$btn_title</a>";
			}
			echo '</div>';
		}

		echo		 "<span class='pull-right clickable'><i class='glyphicon glyphicon-chevron-up'></i></span>
			  </div>
			  <div class='panel-body' style='padding : 3px !important;'>
  				<div class=''>
		";
	}
}

if(!function_exists('panel_tail'))
{
	function panel_tail()
	{
		echo "
			</div> 
		  </div>
		</div>
		";
	}
}
